Hybrid coded audio data streaming apparatus and method

ABSTRACT

An audio coding system in which a plurality of quantization methods are selectable for application to components of a streamed audio signal to achieve a target frame size that is determined by comparing an achieved bit rate against a target bit rate. Based on the target frame size, the system calculates a bit allocation for signal components and compares the bit allocation to the dynamic range of the signal components. Depending on the outcome of the comparison, the system may select to quantize or not quantize a signal component. The system employs lossless coding techniques, but is capable of introducing lossy coding by quantization in order to meet the target bit rate.

FIELD OF THE INVENTION

The present invention relates to coded data streaming, especially codedaudio data streaming.

BACKGROUND TO THE INVENTION

Lossless audio coding algorithms are typically precluded from real-timestreaming applications due to their undeterminable and often excessivebit rate. This restriction is often most stringent in wirelesscommunications, where power consumption and complexity are restricted.

As the bandwidth and latency of wired and wireless communicationstechnologies continues to improve there exists new applications foraudio streaming in, for example, consumer electronics such as modularhome audio networking systems, portable media players (PMPs) andwireless speakers.

It would be desirable to utilize this increasing data bandwidth toperform real-time wireless streaming of audio data coded in a losslessor near-lossless format. In particular, it would be desirable to be ableto stream audio data at lossless, or at least perceptually-lossless,quality over a transmission channel having bandwidth that isinsufficient to support direct transmission of uncoded audio data.

SUMMARY OF THE INVENTION

A first aspect of the invention provides an audio encoder as claimed inclaim 1.

Preferably, the quantizer is arranged not to quantize said signalcomponents if said comparison of said respective dynamic range with saidrespective component bit allocation indicates that said respectivedynamic range can be losslessly accommodated by said respectivecomponent bit allocation. Typically, said quantizer is arranged toquantize said signal components if said comparison of said respectivedynamic range with said respective component bit allocation indicatesthat said respective dynamic range cannot be losslessly accommodated bysaid respective component bit allocation.

In preferred embodiments, the quantizer is configured to support aplurality of selectable different quantization methods, the encoderbeing arranged to select one or other of said quantization methods forapplication to said received signal components depending on saidcomparison of said respective dynamic range with said respectivecomponent bit allocation. Each quantization method is configured toapply a respective different level of quantization. Advantageously, oneof said quantization methods is configured to apply no quantization.Hence signals can pass losslessly through the quantizer if appropriate.

The encoder may be arranged to select one or other of said quantizationmethods for application to said received signal components depending onthe extent by which the number of bits required to accommodate therespective dynamic range exceeds the respective component bitallocation.

In order to calculate said respective component bit allocation for eachsignal component, said encoder may be arranged to assign a respectivelossless bit allocation to each signal component, said lossless bitallocation corresponding to the respective dynamic range of the signalcomponent, to compare the total of the lossless bit allocations with atotal bit allocation for the respective slice and, if the total of thelossless bit allocations exceeds the total bit allocation for therespective slice, to reduce one or more of the respective lossless bitallocations until the total of the initial bit allocations does notexceed the total bit allocation for the respective slice.

Preferably, said encoder is arranged to reduce the bit allocation of oneor more signal components in an order corresponding to a weighting ofsaid signal components, wherein said weighting is preferably determinedby the relative perceptual significance of said signal components to ahuman listener. If the total of the lossless bit allocations does notexceed the total bit allocation for the respective slice, the encodermay use said lossless bit allocations as said component bit allocations.

In typical embodiments, the encoder includes a pre-quantization coderarranged to apply one or more data compression methods, preferablylossless data compression methods, to said un-encoded audio datasamples. The pre-quantization coder may apply a spectral decompositiontransform, preferably a lossless transform, to said un-encoded audiodata samples to produce a plurality of spectral audio data components.

Usually, the input signal comprises a plurality of audio channels, saidencoder being arranged to perform said spectral decomposition in respectof each channel, each signal component comprising a respective spectralaudio data component of a respective channel. The pre-quantization codermay perform inter-channel or intra-channel decorrelation of saidchannels.

Typically, the encoder includes a post-quantization coder arranged toapply one or more data compression methods, preferably lossless datacompression methods, to the quantized audio data samples. Thepost-quantization coder arranged to perform inter-channel orintra-channel decorrelation of said channels.

A second aspect of the invention provides an audio data compressionsystem comprising the encoder of the first aspect of the invention and acorresponding decoder arranged for communication with one another acrossa communications link.

A third aspect of the invention provides a method of encoding an audioinput signal as claimed in claim 22.

A fourth aspect of the invention provides a computer program product asclaimed in claim 23.

Preferred embodiments of the invention employ lossless coding techniqueswhere possible, or appropriate, but are configured to selectively switchto lossy coding techniques when a bandwidth threshold, e.g. the averagetransmission channel bandwidth, is reached or it is determined that thebandwidth threshold will be exceeded. Such an approach may be termed“hybrid” lossless/lossy coding.

Preferably, apparatus and methods embodying the invention are arrangedto allow, or cause, real-time changes to the average coded bit rate.This enables optimal performance for a range of possible usage scenariosto be achieved.

Preferred embodiments of the invention comprise a quantizationapparatus, or support a quantization method, that enables hybridlossless and/or lossy coding, and advantageously support transmission ofstreaming audio data over a bandwidth-restricted communications channel.

In typical embodiments, a plurality of quantization methods areselectable for application to components of a streamed audio signal toachieve a target frame size that is determined by comparing an achievedbit rate against a target bit rate. Based on the target frame size, thesystem calculates a bit allocation for signal components and comparesthe bit allocation to the dynamic range of the signal components.

Depending on the outcome of the comparison, the system may select toquantize or not quantize a signal component. The system employs losslesscoding techniques, but is capable of introducing lossy coding byquantization in order to meet the target bit rate.

Further advantageous aspects of the invention will be apparent to thoseordinarily skilled in the art upon review of the following descriptionof a specific embodiment and with reference to the accompanyingdrawings.

BRIEF DESCRIPTION OF THE DRAWINGS

An embodiment of the invention is now described by way of example andwith reference to the accompanying drawings in which:

FIG. 1 is a block diagram of a streaming audio transmission system usingan audio coding algorithm;

FIG. 2 is a block diagram of an encoding and decoding system (codec) forcompressing digital audio data samples, the system embodying theinvention and being an embodiment of the streaming audio transmissionsystem of FIG. 1;

FIG. 3 is a block diagram of an audio encoder embodying the invention,the encoder supporting hybrid quantization and being suitable for use inthe codec of FIG. 2;

FIG. 4 is a block diagram of an embodiment of part of the encoder ofFIG. 3, wherein hybrid quantization is applied to a plurality of spatialchannels and spectral decompositions of those channels;

FIG. 5 is a flow diagram illustrating a preferred bit allocation methodsuitable for use by the encoder of FIG. 3; and

FIG. 6 shows mathematical equations representing an embodiment of aquantization scheme suitable for use in the encoder of FIG. 3.

DETAILED DESCRIPTION OF THE DRAWINGS

Referring now to FIG. 1 of the drawings there is shown, generallyindicated as 10, an audio transmission system comprising an audioencoder 12 and an audio decoder 14 (which may collectively be referredto as a codec) capable of communicating with each other via acommunications link 16. The communications link 16 may be wired, but inthe present example is assumed to comprise a wireless link. Hence, theencoder 12 comprises, or is co-operable with, a wireless transmitter ortransceiver (not shown) and the decoder 14 comprises, or is co-operablewith, a wireless receiver or transceiver (not shown). The communicationslink 16 supports a data transmission channel between the encoder 12 anddecoder 14 with a maximum bandwidth, which in this example is denoted asT and may be measured in bits per second.

In use, the encoder 12 receives an input signal comprising audio datasamples. The data samples are received at a rate denoted as R in thisexample, which may be measured in bits per second. The data samplestypically comprise pulse code modulated (PCM) data samples, but mayalternatively comprise any other suitable digital, or digitized, datasamples. The decoder 14 produces an output signal comprising audio datasamples. The data samples are assumed to be output at the same rate Rand are assumed to comprise pulse code modulated (PCM) data samples, butmay alternatively comprise any other suitable digital, or digitized,data samples.

Hence, the digital audio stream has an uncoded bit rate of R bits persecond and needs to be coded by the encoder 12 and sent over thetransmission channel 16, which is capable of transmitting a maximum bitrate of T bits per second, where T<R.

The system 10 may be said to be a streaming transmission system sincethe data is streamed in real time from the encoder 12 to the decoder 14.The delay between data being received by the encoder 12 and being outputby the decoder 14 is the latency of the system 10. In this example,latency is denoted e by L, and may be measured in seconds.

Ideally, the encoder 12 is configured to apply one or more losslesscompression methods to the unencoded incoming data to produce coded datafor transmission across the link 16. The compression reduces the bitrate of the data stream compared to the uncoded rate R, the aim being toreduce the bit rate such that it does not exceed T. In alternativeembodiments, the encoder 12 may be configured to apply one or more lossycompression methods to the unencoded incoming data (e.g. instead oflossless techniques). However, such embodiments suffer less from theproblems outlined below and so are less compatible with the aims of theinvention.

Any suitable lossless compression method(s) may be employed, for examplespectral decomposition (commonly referred to as sub-band coding (SBC))and/or inter-channel decorrelation. Lossless compression techniques,such as spectral decomposition (sub-banding) and intra-channel, orinter-channel, decorrelation, may be used to reduce the bit rate ofaudio data by exploiting the redundancies that are typically inherent insuch audio signals. The efficiency of lossless compression techniques isdependent on the statistics of the audio content of the audio signals;therefore the achievable coded bit rate is variable and indeterminate.This poses a problem for communications systems in which the channeltransmission bandwidth may be insufficient to convey either theshort-term or long-term audio bandwidth. Also, in some systems thebandwidth utilized by the audio coding algorithm must be restrictedunder certain circumstances, for example low power operation or as aconsequence of quality of service considerations.

Accordingly, in systems embodying the invention, the encoder 12selectively quantizes the data during the coding process in order thatthe maximum bit rate supported by the channel 16, or other target bitrate, is not exceeded. Advantageously, quantization, when performed, isperformed in addition to any lossless (or lossy) compression method(s)that are implemented by the encoder 12. Hence, preferred embodiments ofthe encoder 12 support modification of an otherwise-lossless audiocoding algorithm to selectively apply quantization. Quantization of theaudio samples approximates a large set of discrete values using asmaller set, thereby reducing the volume of information present in thatdata set. However, this process can introduce unwanted artifacts andquantization noise that degrade the audio quality experienced by thelistener. Quantization is a process that irreversibly loses information,therefore it should be carefully applied such that the distortion iscontrolled and perceptually important audio signals are retained.

FIG. 2 shows an embodiment of the system 110 in more detail, wherein theencoder 12 and decoder 14 are adapted to embody the invention. Theencoder 12 receives an input signal comprising N channels of uncoded, oruncompressed, audio data samples, where N is typically greater than 1,but may be equal to 1. The preferred encoder 12 comprises means forperforming preliminary coding of the input signal, which in FIG. 2 isrepresented by preliminary, or pre-quantization, coding module 18. Thepreferred module 18 is configured to perform lossless compression codingon the data samples to produce a losslessly compressed data signal. Anysuitable conventional lossless compression method(s) may be implemented(audio lossless compression methods in typical embodiments). Typically,the module 18 is configured to perform spectral (frequency)decomposition of the input signal into a plurality of frequencysub-bands. This may be achieved using any convenient sub-band codingtransform preferably a lossless transform, for example an IntegerWavelet Transform (IWT) or an Integer MDCT (Modified Discrete CosineTransform). In the preferred embodiment IWT is used to decompose theaudio signal into a variable number of sub-bands. Spectral decompositionallows the spectral components (sub-bands) of the input signal to bemanipulated by the encoder 12 separately, which is advantageous sincesub-bands tend to have different relative perceptual importance tolisteners. Where the input signal comprises more than one channel,spectral decomposition may be performed separately on each channel.Alternative embodiments may omit the spectral decomposition, or mayinclude it as a selectable option.

Optionally, the module 18 is configured to, or configurable to, performinter-channel decorrelation, and/or intra-channel decorrelation, wherethe input signal comprises more than one channel. In preferredembodiments, the spectral decomposition is performed beforehand and thechannel signals are decorrelated on a sub-band basis.

The encoder 12 includes means for selectively quantizing the partiallycoded signal produced by the module 18, which in FIG. 2 is representedby hybrid quantization module 20. The hybrid quantization module 20 isconfigured to process each sub-band of the partially coded signalseparately. Where there are more than one channels, the hybridquantization module 20 may be configured to process each channelseparately, and optionally each sub-band component of each channelseparately. In particular, the hybrid quantizer may be arranged toperform compression on each channel and sub-band separately. However,when determining the type and level of quantization to be used thechannel and sub-band data can be analyzed individually (simple) orcollectively (more processing effort required). When it is collectivelyanalyzed the perceptual quality of the compressed audio will tend to behigher as redundancies across channels and sub-bands can be exploited.

Typically, the encoder 12 includes means for performing final coding ofthe input signal, which in FIG. 2 is represented by post-quantizationcoding module 22. The preferred module 22 is configured to perform oneor more lossless compression methods on the data signal produced by thehybrid quantization module 20. Any suitable conventional losslesscompression method(s) may be implemented (typically audio losslesscompression methods). In typical embodiments the module 20 is configuredto perform lossless entropy encoding, e.g. Golomb-Rice entropy encoding.Alternatively, the module 22 may be configured to perform lossycompression, although this is less compatible with the aims of theinvention.

More generally, module 18 and/or module 22 may be configured to perform,or be configurable to perform, one or more coding methods, including oneor more compression methods (preferably lossless compression methods),on the audio data. In typical embodiments, the coding methods mayinclude sub-band coding and/or inter-channel or intra-channeldecorrelation. The preferred encoder 12 implements sub-band coding andinter-channel decorrelation before quantization, with intra-channeldecorrelation and Golomb-Rice entropy coding after quantization. Thesetechniques are applied external to the hybrid quantizer to compress thedata, preferably in a lossless manner. Should the quantizer not performany quantization the encoder 12 relies on these coding tools to provideall data compression.

Modules 18 and 22 are optional and either or both may be omitted (atleast to the extent that they perform compression) from the encoder 12(and correspondingly from the decoder 14), or modified so that thecompression techniques are de-activated. In practice, somepre-quantization signal processing is usually performed not necessarilyrelating to compression, e.g. framing. Module 18, and/or any othersuitable pre-processing module(s), may be configured to implement anynecessary pre-processing of audio signals before quantization.Similarly, some post-quantization signal processing is usually performednot necessarily relating to compression, e.g. bit rate measurement,packing, overhead handling. Module 22, and/or any other suitablepost-processing module(s), may be configured to implement any necessarypost-processing of audio signals after quantization.

The module 22 produces a compressed output signal for sending to thedecoder 14 across the communications link 16.

The encoder 12 includes means for controlling the operation of thehybrid quantization module 20 depending on the performance of thepost-quantization coding module 22. In preferred embodiments, theoperation of the hybrid quantization module 20 is controlled by bitallocation means (represented in FIG. 2 as module 24), which isresponsive to input received from bit rate control means (represented inFIG. 2 by module 26), which in turn is responsive to an output from thepost-quantization coding module 22. This is described in further detailbelow.

In order to achieve a determinate bit rate for the coded output signal,the audio data is advantageously structured into frames, each framecomprising a finite number of audio data samples. Conveniently, theaudio data is structured into frames prior to module 18 as it iscaptured by the encoder 12, by any suitable conventional framing means.This enables the coding process to be modified on a frame-by-frame basissuch that it can adapt to the characteristics of audio content. Thisadaptation is preferably performed by a rate control algorithm thatprovides each frame with a target number of bits to be produced by ahybrid quantization scheme.

FIG. 3 shows an alternative block diagram of the encoder 12 in whichlike numerals are used to indicate like parts. The rate controller 24receives a target bit rate for each frame, which in this example isassumed to be T, matching the maximum bandwidth of the transmissionchannel 16, although in alternative embodiments the target bit rate neednot match the maximum bandwidth of the transmission channel 16. Thepost-quantization coding module 22 is configured to output a stream ofcoded audio data arranged in frames. The post-quantization coding module22 is further configured determine the actual bit rate achieved for eachoutput frame. Module 22 communicates an actual bit rate to the ratecontroller 24. The communicated achieved bit rate may for example be thebit rate of the most recently transmitted coded audio data frame or themost recently created coded audio data frame, or other audio data framecreated by the module 22. The rate controller 24 is configured tocalculate a target frame size F from the target bit rate and thecommunicated achieved bit rate. For example, the rate controller 24 maycompare the achieved bit rate to the target bit rate and to use anon-linear function to determine the target frame size F. Any functionthat derives a target frame size using the target bit rate and achievedbit rate (A) of each frame can be used, e.g. F=f(T,A). Preferably, anon-linear function is used that is dependent on accumulated bit rateerror such that the target frame size F decreases exponentially as thenumber of bits produced increases beyond a threshold. Controlling theframe size allows the bit rate of the system to be dynamically modifiedaccording to the requirements of the transmission channel and the audiocontent. The target bit rate can be set arbitrarily by the system 10 dueto other application considerations such as power consumption (e.g. whenplugged into a charger, a mobile device can increase the wireless bitrate) or a varying channel bandwidth (e.g. a combination WiFi/Bluetoothchip transmits audio over Bluetooth but reduces the Bluetooth channelbandwidth when experiencing heavy WiFi usage).

The pre-quantization coding module 18 is configured to communicate tothe bit allocation module 26 a respective dynamic range for eachcomponent, e.g. each spectral component, of the audio data signal. Inthe preferred embodiment, a respective dynamic range is provided foreach slice of the signal, preferably each spectral component of eachslice. Typically, the dynamic range comprises a value indicating thedifference between the respective maximum and minimum values, toindicate the signal power. In the present example, the dynamic range iscalculated it is the log base 2 of the absolute maximum signal level ofeach sub-band component.

The target frame size F and the respective dynamic ranges are used bythe bit allocation means 26 to allocate bits to respective components ofthe audio data signal, e.g. spectral components, the number of allocatedbits being used to determine how the respective signal component isprocessed by the hybrid quantization module 20.

In the illustration of FIG. 3, the hybrid quantization module 20comprises a quantization control component 28 and a quantizationimplementation component 29. The quantization implementation component29 supports a plurality of selectable quantization options that may beapplied to the data signal received from the pre-quantization codingmodule 18. The bit allocation module 26 operates in conjunction with aquantization control module 28 to determine how the respective audiosignal components are processed by the quantization implementationmodule 20.

FIG. 4 shows part of the encoder 12, like numerals being used to denotelike parts, illustrating how in typical embodiments the received uncodedaudio data signal comprises a plurality of channels (channel 0 tochannel N−1) each of which is subjected separately to spectraldecomposition by the pre-quantization coding module 18 before beingsubjected to other pre-quantization coding as applicable. This producesa respective plurality of spectral signal components 30 for eachchannel. After the applicable pre-quantization coding is performed, therespective spectral components for each channel are provided to thehybrid quantization module 20. These signal components may be referredto as the spatial and spectral 10, components of the audio signal. Thechannels may be referred to as spatial channels since each channelrepresents audio data at a different position in space. The spectralcomponents of each channel can be processed individually or jointlydepending upon the coding tool.

The pre-quantization coding module 18 (or other pre-quantization module)may be configured to communicate to the bit allocation module 26 arespective dynamic range for each spatial and spectral component of theaudio data signal. Alternatively, the pre-quantization coding module 18may provide the audio signal components to the module 26, the module 26being configured to determine the dynamic range of the components.

The hybrid quantization module 20 produces an output comprisingselectively quantized spatial and spectral signal components. Typically,quantisation is performed separately on a per channel basis, althoughdeciding how to quantize and by how much can be performed separately orjointly.

Where there is only one channel, i.e. N=1, it will be apparent that thepre-quantization module 18 and hybrid quantizer 20 may operate insubstantially the same manner as described above.

In preferred embodiments, the operation of the encoder 12 to performhybrid quantization is as follows: audio coding methods are utilized (bymodule 18 and/or module 22) to reduce the bit rate of the compressedaudio stream preferably by means of lossless compression; the audio datasignal is segmented into frames each comprising a finite number of audiodata samples; each audio frame is assigned a total number of bits Faccording to a rate control mechanism; preferably, each frame is furthersegmented into a plurality of sub-components, hereinafter referred to asslices, each slice comprising part of the audio signal at a respectivetime interval; the total number of bits F assigned to each frame is usedto determine a bit allocation for each slice of the respective frame.Preferably, each slice comprises a respective part of the spectralcomponents of the audio signal at respective time interval.

In preferred embodiments, the audio data is structured into multiplechannels with multiple spectral components in each channel. The data isdivided into successive time slices, each slice relating to a respectivetime interval, and where each slice comprises a plurality of spectralcomponents, each corresponding to part of a respective spectralcomponent of the audio signal. So, where there is more than one channel,each slice comprises S spectral components across N channels (typicallyrespective sub-groups of the S spectral components belong to arespective one of the N channels). This is illustrated in FIG. 4, wherea slice is indicated as 31). Where N=1, each slice comprises a pluralityof spectral components, each corresponding to part of a respectivespectral component of the audio signal.

Each audio data frame comprises an integer number of slices. Thespectral components of each slice may have a different perceptualimportance to the human hearing system (depending on frequency).Therefore the determination of how many bits from the frame size Fshould be assigned to each component of a slice is advantageously madeaccording to their respective perceptual importance, among other factorssuch as dynamic range. Every slice within a frame is then quantizedusing the bits that have been allocated to the respective slicecomponents on a slice by slice basis. Conveniently, the same bitallocation for the various components of a slice is used for each slicein a frame, but may be changed for subsequent frames.

In embodiments where spectral decomposition of the audio signal isperformed (e.g. in module 18), it is preferred to utilize a losslesstransform (which may be implemented by a lossless filter) for thespectral decomposition in order to maintain the ability to achievemathematically lossless compression (and therefore losslessdecompression). For example an Integer Wavelet Transform or an IntegerModified Discrete Cosine Transform could be used for this purpose.Alternatively, a lossy transform could be used.

During bit allocation, the preferred encoder 12 takes into account thespatial and spectral importance of the audio content since the audiosignal is decomposed into such components. This enables the preferredhybrid quantization method to consider the perceptual importance of eachcomponent of the audio signal with respect to the others whendetermining distribution of quantized bits.

Referring now to FIG. 5, there is shown a preferred method of bitallocation, which may be performed in whole or in part, as isconvenient, by the bit allocation module 26. The audio signal componentsare analyzed to determine the appropriate level of quantization that isrequired to achieve the target bit rate. This is achieved by determininghow many bits each signal component must be represented by.

At block 501, the audio data components are analyzed to determine therespective dynamic range of each of the spatial and spectral componentsacross each slice of each frame. The respective dynamic range is used todetermine (block 502) an initial (lossless) bit allocation D for theslice (i.e. a respective allocation of bits to each component of theslice) which, if used during hybrid quantization, will result in nolossy compression being applied to the respective signal component. Thisanalysis may be performed in module 18 or module 26 as is convenient.Typically, the dynamic range of each component is computed as themaximum range of the respective component over all slices in each frame.

At block 503, at test is made to determine if the lossless bitallocation D is less than or equal to the respective slice bitallocation. In this context, the slice bit allocation is the totalnumber of bits available for the respective slice which, in a simpleembodiment, is calculated by dividing the target frame size F by thenumber of slices in the frame. If it is, then the lossless bitallocation is set as the respective slice bit allocation for thepurposes of hybrid quantization.

If the respective lossless bit allocation D is not less than or equal tothe respective slice bit allocation, then the lossless bit allocation Dis adjusted, preferably on the basis of a tilt (weighting) appliedacross the respective slice components according to any spectraldecomposition that has occurred (block 504). Advantageously, the tiltapplies a greater perceptual importance to lower frequencies. Forexample, the spectral tilt may apply a weighting to the spectralcomponents of each channel according to perceptual importance, such thatlower frequencies are favoured when determining an initial bitallocation. An iterative process may then employed to obtain a bitallocation across the slice that meets the respective slice bitallocation. A single bit allocation is conveniently performed for eachframe and is applied to every slice within that frame.

At block 505, an iterative process is applied to reduce the respectivenumber of bits assigned to one or more of the components of therespective slice until the total bit allocation for the slice isreached. In the preferred embodiment, this process involves reducing thebits allocated to each temporal and spectral component in a sequentialmanner. The preferred sequence begins with the least perceptuallyimportant component of the slice and proceeding in sequence toprogressively more perceptually important components, finishing with themost perceptually important component. The sequence may be repeated onceor more until the required frame bit allocation is reached.

Once the bit allocation for each slice of each frame has beendetermined, the quantization scheme is selected. In the illustratedembodiment, this is performed by the hybrid quantizer 20 and inparticular by the quantization control module 28. The preferredselective quantization process comprises the following options:

(1) If the respective individual bit allocation for a signal componentis equivalent to the respective dynamic range of the respective audiosignal component, then the respective audio signal component is notquantized. Where the dynamic range is measured in bits, then this testmay conveniently be made by determining if the dynamic range is equal to(or alternatively not more than) the slice bit allocation.

(2) If the respective individual bit allocation is less than required bythe respective dynamic range of the respective audio signal component,and if the respective individual bit allocation is relatively high (e.g.exceeding a predetermined threshold value, which may be determinedexperimentally), and, preferably also, if the respective audio signalcomponent also has a high dynamic range in comparison to the sampledepth of the uncompressed audio, a truncation function is applied to therespective audio signal component to produce a corresponding truncatedsignal component, whose size matches the respective component bitallocation; or

(3) If the respective bit allocation of a respective audio signalcomponent is low with respect to its dynamic range (e.g. less thanrequired by the respective dynamic range of the respective audio signalcomponent), a quantization scheme is applied to the respective audiosignal component to produce a corresponding quantized signal component.Preferably, a non-adaptive uniform scalar quantization scheme isapplied. Advantageously, the quantization scheme provides for moreaggressive bit reduction of an audio signal component than truncation.

FIG. 6 shows a set of equations describing a preferred selectivequantization process, where D is the dynamic range, B is the allocatednumber of bits, A is the sample depth, T_(thresh) is a first truncationthreshold, T_(c) is a second threshold called the truncation cut-off, xis the signal to be quantized and q is the selectively quantized signal(which in this example may comprise x (no quantization or truncation),or quantized or truncated versions of x).

Equation [2] shows how the dynamic range of a respective signalcomponent may be calculated. Equation [3] calculates a parameter s,whose value is indicative of whether or not the dynamic range (measuredin bits) of the respective audio signal component exceeds the respectivebit allocation for that component. Equation [1] shows how a selected oneof three functions is applied to the audio signal component dependingon, in particular, the value of s, but preferably also on otherconditions.

It will be understood that the invention is not limited to the threefunctions shown in FIG. 6, and that more generally, a plurality ofquantization functions are supported for selection and implementation bythe hybrid quantizer 20. Preferably, one of the functions is anon-quantizing, e.g. a null function, which passes the audio signalcomponent through the hybrid quantizer 20 unaffected. Preferably, thereis at least one other selectable function that quantizes the audiosignal component (in the context of the invention, truncation isconsidered to be a form of quantization). More preferably, there are atleast two other selectable functions that quantize the audio signalcomponent with respective different degrees of severity (i.e. applyhigher or lower levels of quantization with respect to one another). Theselection of which function to apply is determined by a comparison ofthe dynamic range of the audio signal component with the respective bitallocation for that component.

Advantageously, if the respective bit allocation is large enough toaccommodate (losslessly) the respective dynamic range, then the nullfunction is selected. Otherwise one of the other available functions isselected. Selection between the other functions may be determined by theamount by which the respective bit allocation is less than is requiredto accommodate (losslessly) the respective dynamic range, e.g. one ormore threshold values may be set and a function selected depending onthe value of parameter s with respect to the threshold(s). By“accommodate” it is meant that the data values in the respective dynamicrange can be represented using the bit allocation. Alternatively, or inaddition, selection between the other functions may be determined by oneor more other characteristics of the audio signal component (such asdynamic range) and/or the uncompressed audio signal (e.g. sample depth).

The audio signal components are quantized (or not quantized) as per thebit allocation and quantization schemes that have been selected. Furthersignal processing can then be applied to the quantized audio signals(e.g. by post-quantizing coding module 22). This results in a compressedaudio frame that can be encapsulated within coded stream syntax andtransmitted across link 16. The size of the transmitted audio frame isdetermined (e.g. by post-quantizing coding module 22) and iscommunicated to rate controller 24 as described above. The bits producedand the bits allocated to each frame are processed using a rate controlmechanism to provide a bit allocation for the subsequent frame.

The data transmitted to the decider 14, in particular the coded streamsyntax, provides the decoder 14 with the respective dynamic range of therespective spatial and spectral components, as well as an indication ofthe respective coding decisions, including which quantization functionwas selected, made at the encoder 12. This information is used by thedecoder 14 to reproduce the bit allocation generated by the encoder 12.The decoder 14 comprises an inverse hybrid quantization module 40arranged to apply an corresponding inverse hybrid quantization process.The inverse quantization process is performed by first selecting thesame quantization scheme as the encoder 12. The respective inversehybrid quantization process is then performed to reconstruct the audiosignal components. Any necessary audio decoding functions (correspondingto the coding functions applied by the encoder 12) are then applied toreconstruct the original uncompressed audio signal. In FIG. 2, this isperformed by post-quantization and pre-quantization audio decodingmodules 42, 44.

The preferred audio coding algorithm utilizes no inter-framedependencies in order to enable each frame to be decoded in isolation.This reduces the effects of packet loss in a real-time transmissionsystem.

It will be understood from the foregoing that the dynamically variabletarget frame size F provides a feedback loop to control a bit allocationsystem. The bit allocation system analyzes the compressed (preferablylosslessly compressed) audio signals to determine an appropriate bitallocation for each audio signal component, e.g. channel and sub-bandcomponents, based upon the frame's target size. The preferred bitallocation system reduces the loss of quality associated withquantization by allocating bits based upon the perceptual importance ofthe frequency, the dynamic range and the channel relationship of audiosamples. If inter-channel decorrelation is applied, e.g. stereo ormultichannel data is exploited, then each channel contains data ofvarying perceptual importance. Therefore, it is preferred to apply aspatial tilt to the data prior to the iterative slice bit allocationprocess, in a similar manner to the spectral tilt that weights thespectral components of each slice. For example, low frequency samplesmay be allocated more bits than high frequency samples as the humanhearing system is more susceptible to detecting distortion at lowerfrequencies.

Each component of encoders, decoders or codecs embodying the inventionmay be implemented as hardware or by computer program(s). As a resultencoders, decoders or codecs embodying the invention may be implementedin hardware, by computer program(s) running on suitable hardware, or amixture of the two.

The invention is not limited to the embodiments described herein, whichmay be modified or varied without departing from the scope of theinvention.

1. An audio encoder arranged to receive an input signal comprising a stream of un-encoded audio data samples and to produce an output signal comprising a stream of encoded audio data samples, the encoder being configured to arrange said audio data samples into a plurality of data frames, and to further arrange each frame into at least one slice, each slice comprising a respective part of at least one component of the input signal, the encoder further being arranged, in respect of a data frame of said output signal, to determine an achieved bit rate that is indicative of the actual bit rate of said data frame, and to calculate a target frame size for a subsequent data frame by comparing said achieved bit rate against a target bit rate, and wherein said encoder is arranged to determine a respective component bit allocation for the or each slice of said subsequent frame based on said target frame size, said component bit allocation comprising a respective bit allocation for said at least one component of the input signal, the encoder further being arranged to determine a respective dynamic range for said at least one component of the input signal in respect of said subsequent frame, and to compare said respective dynamic range with said respective component bit allocation, the encoder comprising a quantizer arranged to receive said at least one component of the input signal in respect of said subsequent frame and to selectably quantize or not quantize said received signal components depending on comparison of said respective dynamic range with said respective component bit allocation.
 2. An encoder as claimed in claim 1, wherein said quantizer is arranged not to quantize said signal components if said comparison of said respective dynamic range with said respective component bit allocation indicates that said respective dynamic range can be losslessly accommodated by said respective component bit allocation.
 3. An encoder as claimed in claim 1, wherein said quantizer is arranged to quantize said signal components if said comparison of said respective dynamic range with said respective component bit allocation indicates that said respective dynamic range cannot be losslessly accommodated by said respective component bit allocation.
 4. An encoder as claimed in claim 1, wherein said quantizer is configured to support a plurality of selectable quantization methods, the encoder being arranged to select one or other of said quantization methods for application to said received signal components depending on said comparison of said respective dynamic range with said respective component bit allocation.
 5. An encoder as claimed in claim 4, wherein each quantization method is configured to apply a respective different level of quantization.
 6. An encoder as claimed in claim 4, wherein one of said quantization methods is configured to apply no quantization.
 7. An encoder as claimed in claim 4, wherein said encoder is arranged to select one or other of said quantization methods for application to said received signal components depending on the extent by which the number of bits required to accommodate the respective dynamic range exceeds the respective component bit allocation.
 8. An encoder as claimed in claim 4, wherein at least one of said quantization methods comprises a non-adaptive uniform scalar quantization method.
 9. An encoder as claimed in claim 4, wherein at least one of said quantization methods comprises a truncation function.
 10. An encoder as claimed in claim 1, wherein in order to calculate said respective component bit allocation for each signal component, said encoder is arranged to assign a respective lossless bit allocation to each signal component, said lossless bit allocation corresponding to the respective dynamic range of the signal component, to compare the total of the lossless bit allocations with a total bit allocation for the respective slice and, if the total of the lossless bit allocations exceeds the total bit allocation for the respective slice, to reduce one or more of the respective lossless bit allocations until the total of the initial bit allocations does not exceed the total bit allocation for the respective slice.
 11. An encoder as claimed in claim 10, wherein said encoder is arranged to reduce the bit allocation of one or more signal components in an order corresponding to a weighting of said signal components, wherein said weighting is preferably determined by the relative perceptual significance of said signal components to a human listener.
 12. An encoder as claimed in claim 10, wherein if the total of the lossless bit allocations does not exceed the total bit allocation for the respective slice, the encoder is configured to use said lossless bit allocations as said component bit allocations.
 13. An encoder as claimed in claim 11, wherein during said reduction of bits, one or more bits are removed from the respective bit allocation of one or more signal components deemed to be of relatively low perceptual significance.
 14. An encoder as claimed in claim 1, wherein the encoder includes a pre-quantization coder arranged to apply one or more data compression methods, preferably lossless data compression methods, to said un-encoded audio data samples.
 15. An encoder as claimed in claim 1, wherein the encoder includes a pre-quantization coder arranged to apply a spectral decomposition transform, preferably a lossless transform, to said un-encoded audio data samples to produce a plurality of spectral audio data components.
 16. An encoder as claimed in claim 15, wherein each signal component comprises a respective spectral audio data component.
 17. An encoder as claimed in claim 16, wherein said input signal comprises a plurality of audio channels, said encoder being arranged to perform said spectral decomposition in respect of each channel, each signal component comprising a respective spectral audio data component of a respective channel.
 18. An encoder as claimed in claim 1, wherein said input signal comprises a plurality of audio channels, said encoder including a pre-quantization coder arranged to perform inter-channel or intra-channel decorrelation of said channels.
 19. An encoder as claimed in claim 1, wherein the encoder includes a post-quantization coder arranged to apply one or more data compression methods, preferably lossless data compression methods, to the quantized audio data samples.
 20. An encoder as claimed in claim 1, wherein said input signal comprises a plurality of audio channels, said encoder including a post-quantization coder arranged to perform inter-channel or intra-channel decorrelation of said channels.
 21. An audio data compression system comprising an encoder as claimed in claim 1 and a decoder arranged for communication with one another across a communications link.
 22. A method of encoding an audio input signal comprising a stream of un-encoded audio data samples and to produce an output signal comprising a stream of encoded audio data samples, the method comprising: arranging said audio data samples into a plurality of data frames, and to further arrange each frame into at least one slice, each slice comprising a respective part of at least one component of the input signal, determining, in respect of a data frame of said output signal, an achieved bit rate that is indicative of the actual bit rate of said data frame, and to calculate a target frame size for a subsequent data frame by comparing said achieved bit rate against a target bit rate, determining a respective component bit allocation for the or each slice of said subsequent frame based on said target frame size, said component bit allocation comprising a respective bit allocation for said at least one component of the input signal, determining a respective dynamic range for said at least one component of the input signal in respect of said subsequent frame, and to compare said respective dynamic range with said respective component bit allocation, selecting to quantize or not quantize at least one component of the input signal in respect of said subsequent frame depending on comparison of said respective dynamic range with said respective component bit allocation.
 23. A computer program product comprising a non-transitory computer readable medium containing computer program code for causing a computer to perform the method of claim
 22. 